 {

        var o = require("./UISoundManager.js"), i = require("./UIPopupBase.js");
        cc.Class({
            extends: i,
            properties: {
                _hadDiamond: 0,
                _count: 0,
                defaultHeadImage: cc.SpriteFrame
            },
            init: function () {
            },
            onLoad: function () {
                this._shareList = Global.utils.searchNode(this.node, "shareList"), Global.msgHandler.requestGetWorldCupMsg();
            },
            setData: function (e) {
                this.showItem(e.friendDiamond, e.friendPurls, e.friendHadReward), Global.utils.searchComp(this.node, "dailyTotal", cc.Label).string = "每日登录（" + e.hadDayCount + "/2）",
                    Global.utils.searchComp(this.node, "rewardDailyNum", cc.Label).string = "+" + e.dayAddDiamond[0].count;
                var t = Global.utils.searchNode(this.node, "btn_getDailyReward");
                if (0 == e.canRewardDay) {
                    t.getComponent(cc.Button).interactable = !1;
                    var n = t.getComponent(cc.Sprite);
                    Global.spriteAtlas.setSpriteFrame(n, "Texture/shareGetDiamond", "TY_ICON4"), n = Global.utils.searchComp(t, "Label", cc.Sprite),
                        Global.spriteAtlas.setSpriteFrame(n, "Texture/shareGetDiamond", "CG_AnNiuZi_8");
                } else {
                    t.getComponent(cc.Sprite).spriteFrame = Global.spriteAtlas.getNormalButton();
                    var o = Global.utils.searchComp(t, "Label", cc.Sprite);
                    Global.spriteAtlas.setSpriteFrame(o, "Texture/shareGetDiamond", "CG_AnNiuZi_3"),
                        t.getComponent(cc.Button).interactable = !0;
                }
                this._hadDiamond = e.hadShareDiamond;
            },
            pullPrize: function (e) {
                if (console.log("pullPrize data=", e), e) if (e.error) Global.utils.showNodeCommon(e.error.info, 3); else {
                    var t = function () {
                        Global.msgHandler.requestGetWorldCupMsg(), Global.notificationCenter.emit(Global.eventName.MSG_REFRESH_TICK_NUM, e.result.hadShareDiamond);
                    }, n = this;
                    cc.loader.load({
                        url: "http://szh5.nalrer.cn/cdn37/hall/pdt/imgs/zuqiupiao.png",
                        type: "png"
                    }, function (o, i) {
                        try {
                            var a = {
                                reward: e.result.hadShareDiamond - n._hadDiamond,
                                pic: new cc.SpriteFrame(i),
                                name: "个",
                                type: "share"
                            };
                            Global.UIPopupManager.addPopup("PopupPanel/Panel_shareGroup_Reward", function (e) {
                                e.getComponent("shareGroup_RewardPanel").setData(a, t);
                            });
                        } catch (e) {
                            cc.error("shareToGroupPanel", "Error = " + e);
                        }
                    });
                }
            },
            showItem: function (e, t, n) {
                for (var o = this, i = function () {
                    r = e[a].count;
                    var i = o.getItem(a);
                    i.active = !0, Global.utils.searchComp(i, "num", cc.Label).string = "+" + r, Global.utils.searchComp(i, "tip", cc.Label).string = a,
                        s = Global.utils.searchNode(i, "btn_receive"), l = Global.utils.searchNode(i, "received"),
                        c = Global.utils.searchComp(i, "inviteNum", cc.Label);
                    var h = s.getComponent(cc.Sprite);
                    if (Global.spriteAtlas.setSpriteFrame(h, "Texture/shareGetDiamond", "TY_ICON4"),
                        h = Global.utils.searchComp(s, "Label", cc.Sprite), Global.spriteAtlas.setSpriteFrame(h, "Texture/shareGetDiamond", "CG_AnNiuZi_8"),
                        s.getComponent(cc.Button).interactable = !1, s.active = !0, l.active = !1, t.length > 0) for (d = 0; d < t.length; d++) {
                        if (a == d) {
                            0 == n[d] ? (s.getComponent(cc.Sprite).spriteFrame = Global.spriteAtlas.getNormalButton(),
                                h = Global.utils.searchComp(s, "Label", cc.Sprite), Global.spriteAtlas.setSpriteFrame(h, "Texture/shareGetDiamond", "CG_AnNiuZi_3"),
                                s.on("touchend", o.onBtnReceive, o), s.getComponent(cc.Button).interactable = !0) : (s.active = !1,
                                l.active = !0), c.string = "邀请到" + (a + 1) + "位好友（" + (a + 1) + "/" + (a + 1) + "）",
                                u = null == t[d] ? o.defaultHeadImage : t[d], cc.loader.load({
                                url: u,
                                type: "png"
                            }, function (e, t) {
                                try {
                                    Global.utils.searchComp(i, "spHead", cc.Sprite).spriteFrame = new cc.SpriteFrame(t);
                                } catch (e) {
                                    cc.error("shareToGroupPanel", "Error = " + e);
                                }
                            });
                            break;
                        }
                        c.string = "邀请到" + (a + 1) + "位好友（" + t.length + "/" + (a + 1) + "）";
                    } else c.string = "邀请到0位好友（0/" + (a + 1) + "）";
                }, a = 0; a < e.length; a++) {
                    var r, s, l, c, d, u;
                    i();
                }
            },
            getItem: function (e) {
                if (this._shareList) {
                    if (e < this._shareList.children.length) return this._shareList.children[e];
                    var t = cc.instantiate(this._shareList.children[0]);
                    return this._shareList.addChild(t), t;
                }
            },
            onBtnReceive: function (e) {
                var t = Global.utils.searchComp(e.target, "tip", cc.Label).string;
                console.log("onBtnReceive ", t), Global.msgHandler.requestShareWorldCup(null, Global.config.rewardType.FRIEND, t);
            },
            onBtnGetDailyReward: function () {
                this._count < 1 ? (Global.msgHandler.requestShareWorldCup(null, Global.config.rewardType.TIME, null),
                    this._count = 1) : this._count = 0;
            },
            onBtnShare: function () {
                console.log("onBtnShare"), cc.sys.platform, cc.sys.WECHAT_GAME;
            },
            OnPanelClose: function () {
                o.playEffect("select"), Global.userProfile.setHadDiamondNum(this._hadDiamond), this.closePanel();
            }
        })
    }